home *** CD-ROM | disk | FTP | other *** search
- /* Program EX_0301.C
- Listing 4C - see documentation in TUTOR.SSS
- */
-
- #include "SSSC.H"
-
- #define free 0
- #define busy 1
-
- double rnx(double m, double s)
- {
- double x;
- do x = RN(m, s);
- while (x <= 0.0);
- return(x);
- }
-
- void prime(void)
- {
- INIQUE(0, 0, 1);
- INISTA(1, "Busy fraction", 1, 0, 0, 0);
- TALLY(1, free);
- SETT(rnx(7, 4));
- TALLY(1, busy);
- }
-
- main()
- {
- prime();
-
- do
- {
- if (RA() < .25) SETT(T()+ER(2, 2));
- else SETT(T()+TR(1, 3, 4));
- TALLY(1, free);
- SETT(T()+rnx(7, 4));
- TALLY(1, busy);
- } while (T() <= 120);
-
- SUMRY("");
- }
-